#!/usr/bin/env python  
# encoding: utf-8   

""" 
@version: v1.0 
@author: null 
@software: PyCharm 
@file: like.py 
@time: 2017.4.29 17:15 
"""

from ..auth import need_login
from weibo.models import Model
from weibo.url import URL
import weibo.settings as config

class Like(Model):
    def __init__(self,isProxy=False):
        super(Like, self).__init__()
        print('like')
        self.proxy = isProxy and config.proxy or {}
        pass

    @need_login
    def likeAdd(self, *args, **kwargs):
        likedata = {
            "id": args[0],
            "st": self.st,
            "attitude": "heart"
        }
        return self.post(URL.likeadd(),likedata,proxy=self.proxy)
        pass

    @need_login
    def likeDelete(self, *args, **kwargs):
        likedata={
            "id":args[0],
            "st":self.st
        }
        return self.post(URL.likedelete(),likedata,proxy=self.proxy)
        pass


